<?php

class checkPopulationFilter extends sfFilter
{

    public function execute($filterChain)
    {
        $module = $this->getContext()->getModuleName();
        $exceptions = array('apartamente', 'auth');
        
        if (!in_array($module, $exceptions) && !BlocPeer::allDefined())
        {
            $this->getContext()->getController()->redirect('apartamente/index');
        }
        else
        {
            $this->execute($filterChain);
        }
    }

}
